﻿using System;
using System.Collections.Generic;
using System.Web;

using Semantics;
using System.Web.UI.WebControls;
/// <summary>
///NodeListWebControl 的摘要说明
/// </summary>
public class NodeListWebControl : WebControl
{
    public NodeListWebControl()
    {
        //
        //TODO: 在此处添加构造函数逻辑
        //
    }

    public void Clear()
    {
        this.Controls.Clear();
    }

    public void ShowNodeList(IList<Node> nodes)
    {
        Table table = new Table();
        this.Controls.Add(table);
        foreach (Node node in nodes)
        {
            TableRow row = new TableRow();
            table.Controls.Add(row);
            TableCell cell = new TableCell();
            row.Controls.Add(cell);
            HyperLink link = new HyperLink();
            link.Text = node.ToString();
            link.NavigateUrl = "WikiNode.aspx?nid=" + node.Id;
            cell.Controls.Add(link);
        }
    }
}
